(function (lib, config) {
    var loadFunc = function () {
        var textAry = config.words.split('|'), bgcolorAry = config.bgcolor.split('|'), textcolorAry = config.textcolor.split('|'), imglinkAry = config.imglink.split('|'), weblinkAry = config.weblink.split('|'), identiAry = config.identifier.split('|');
        textAry[0] = textAry[0] || '西安华都妇产专科医院';
        textAry[1] = textAry[1] || '专家在线解答<font style=\'color:#fff000;\'>妇科</font>问题，26人正在提问';
        textAry[2] = textAry[2] || '西安市女性健康咨询中心';
        textAry[3] = textAry[3] || '西安市卫计委直属医院';
        textAry[4] = textAry[4] || '西安市物价局';
        textAry[5] = textAry[5] || '患者推荐热度（综合）：';
        textAry[6] = textAry[6] || '9.0';
        textAry[7] = textAry[7] || '健康咨询电话：';
        textAry[8] = textAry[8] || '029-62513333';
        textAry[9] = textAry[9] || '执业证号：<font>110610000005628</font>';
        textAry[10] = textAry[10] || '临床经验：';
        textAry[11] = textAry[11] || '40余年';
        textAry[12] = textAry[12] || '您好，您是有女性健康方面的疑问吗？请讲！';
        textAry[13] = textAry[13] || '您可以把您具体情况告诉我，我可以帮您做详细的分析。';
        textcolorAry[0] = textcolorAry[0] || '#ffffff';
        textcolorAry[1] = textcolorAry[1] || '#ec4e43';
        textcolorAry[2] = textcolorAry[2] || '#666666';
        textcolorAry[3] = textcolorAry[3] || '#333333';
        textcolorAry[4] = textcolorAry[4] || '#ec4402';
        textcolorAry[5] = textcolorAry[5] || '#666666';
        textcolorAry[6] = textcolorAry[6] || '#ee7800';
        textcolorAry[7] = textcolorAry[7] || '#666666';
        textcolorAry[8] = textcolorAry[8] || '#ffffff';
        textcolorAry[9] = textcolorAry[9] || '#666666';
        textcolorAry[10] = textcolorAry[10] || '#ee7800';
        textcolorAry[11] = textcolorAry[11] || '#333333';
        textcolorAry[12] = textcolorAry[12] || '#333333';
        textcolorAry[13] = textcolorAry[13] || '#333333';

        bgcolorAry[0] = bgcolorAry[0] || '#ec4e43';
        bgcolorAry[1] = bgcolorAry[1] || '#f2f2f2';
        bgcolorAry[2] = bgcolorAry[2] || '#ffffff';
        bgcolorAry[3] = bgcolorAry[3] || '#ebebeb';
        bgcolorAry[4] = bgcolorAry[4] || '#ec4e43';
        bgcolorAry[5] = bgcolorAry[5] || '#ee7800';
        bgcolorAry[6] = bgcolorAry[6] || '#f5fcff';
        bgcolorAry[7] = bgcolorAry[7] || '#ffffff';
        bgcolorAry[8] = bgcolorAry[8] || '#ec4e43';
        bgcolorAry[9] = bgcolorAry[9] || '#ffffff';
        
        imglinkAry[0] = imglinkAry[0] || 'http://m.hdyy.com.cn/swt/js20171106/img/tel.png';
        imglinkAry[1] = imglinkAry[1] || 'http://m.hdyy.com.cn/swt/js20171106/img/zjzl_l.gif';
        imglinkAry[2] = imglinkAry[2] || 'http://m.hdyy.com.cn/swt/js20171106/img/zjzl_r.gif';
        imglinkAry[3] = imglinkAry[3] || 'http://m.hdyy.com.cn/swt/js20171106/img/yytit1.gif';
        imglinkAry[4] = imglinkAry[4] || 'http://m.hdyy.com.cn/swt/js20171106/img/yytit2.gif';
        imglinkAry[5] = imglinkAry[5] || 'http://m.hdyy.com.cn/swt/js20171106/img/yydl.gif';
        weblinkAry[0] = weblinkAry[0] || 'tel:029-62513333';
        weblinkAry[1] = weblinkAry[1] || 'tel:029-62513333';
        identiAry[0] = identiAry[0] || 'piaofu-tan';
        function getScrollTop() {
            var scrollTop = 0;
            if (document.documentElement && document.documentElement.scrollTop) {
                scrollTop = document.documentElement.scrollTop;
            }
            else if (document.body) {
                scrollTop = document.body.scrollTop;
            }
            return scrollTop;
        }
        function getClientHeight() { //获取可视高度
            var clientHeight = 0;
            if (document.body.clientHeight && document.documentElement.clientHeight) {
                var clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight;
            }
            else {
                var clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight;
            }
            return clientHeight;
        }
        var _ua = navigator.userAgent, _ua_text = false, _position = "fixed";
        if (_ua.indexOf('baiduboxapp') > -1) {
            _ua_text = true; _position = "absolute";
        }
        var htmlStr = [];
        htmlStr.push("<style>");
        htmlStr.push("a{text-decoration:none;}");
        htmlStr.push("p,h1,h2{margin:0;padding:0;}");
        htmlStr.push("ul,li{margin:0;padding:0;list-style:none;}");
        htmlStr.push("#LRdiv2{display:none !important;}");
        htmlStr.push("#swt_center .clear {clear: both;height:0;}");
        htmlStr.push("#swt_center .clear:after{content:'';}");
        htmlStr.push(".swt1_foot .f_text{border-top: none;border-left: none;border-right: none;}");
        htmlStr.push(".zjzjxx .zjzjxx_lip,.zjzjxx_p3 li,.zjzjxx_p3 li p{margin:0 !important;}");
        htmlStr.push("#swt_center img{display: inline-block !important;}");
        htmlStr.push(".center_header{padding: 0.8em 1em;display:-webkit-box;-webkit-box-pack: justify;-webkit-box-align:center;background: " + bgcolorAry[0] + ";position:fixed; max-width: 640px;left: 0;right: 0;margin: 0 auto;box-sizing: border-box;}");
        htmlStr.push(".center_header .headera1{font-size: 1em; color: " + '#fff' + ";}");
        htmlStr.push(".center_header .headerdivc h1{color: " + textcolorAry[0] + ";font-size: 1.33em;text-align: center;margin-bottom: 0.3em;}");
        htmlStr.push(".center_header .headerdivc p{color:" + textcolorAry[1] + "; font-size: 0.8em;text-align: center;}");
        htmlStr.push(".center_header .headera2{width: 8.4%;display: block;}");
        htmlStr.push(".center_header .headera2 img{width: 100%;}");
        htmlStr.push(".conten{width: 93.75%;margin: 1em auto;}");
        htmlStr.push(".yytit{padding: 0.8em 0;background: " + bgcolorAry[1] + ";}");
        htmlStr.push(".yytit h1{text-align: center;font-size: 1.8em;color: " + textcolorAry[2] + ";margin-bottom: 0.3em;}");
        htmlStr.push(".yytit p{width: 95%;background: " + bgcolorAry[2] + ";text-align: center;font-size: 1em;color: " + textcolorAry[3] + ";text-align: center;margin:  0 auto;padding: 0.6em 0;overflow: hidden;white-space:nowrap;}");
        htmlStr.push(".yytit p img{margin-left: 0.3em;margin-right: 0.2em;}");
        htmlStr.push(".content {width: 100%;height: auto;overflow: hidden;margin: 0 auto;background:" + bgcolorAry[3] + ";}");
        htmlStr.push(".zjzl {width: 90%;padding: 0.8em 0;margin: 0 auto;border-bottom: 1px dashed #e4e4e4;overflow:hidden;}");
        htmlStr.push(".zjzl-l {width: 23.75%;float: left;}");
        htmlStr.push(".zjzl-r {width: 70%;float: right;line-height: 180%;color: " + textcolorAry[4] + ";font-size: 1em;}");
        htmlStr.push(".zjzl-r_img{padding-top: 0.1em;padding-bottom: 0.1em;}");
        htmlStr.push(".zjzl-r_img img{ width:65.5%;}");
        htmlStr.push(".zjzl-r p span{ color:" + textcolorAry[5] + ";}");
        htmlStr.push(".zjzjxx{margin: 1em auto;width: 90%;}");
        htmlStr.push(".zjzjxx .zjzjxx_p1{font-size: 1.25em;color: " + textcolorAry[6] + ";text-align: center;}");
        htmlStr.push(".zjzjxx .zjzjxx_p1 font{color:" + textcolorAry[7] + ";}");
        htmlStr.push(".zjzjxx .zjzjxx_p2{display:-webkit-box;-webkit-box-pack: justify;-webkit-box-align:center;font-size: 1em;color: " + textcolorAry[8] + ";}");
        htmlStr.push(".zjzjxx .zjzjxx_p2 li{margin: 0.5em 0;}");
        htmlStr.push(".zjzjxx_p2l{display:-webkit-box;-webkit-box-pack: justify;-webkit-box-align:center;}");
        htmlStr.push(".zjzjxx .zjzjxx_lip{font-size: 29%;background:" + bgcolorAry[4] + ";color: " + textcolorAry[9] + ";border-radius: 0.3em;font-size: 1em;margin-right: 0.4em;text-align: center;padding: 0.2em 0 0.2em 0.2em;}");
        htmlStr.push(".zjzjxx_p3{display:-webkit-box;-webkit-box-pack: justify;-webkit-box-align:center;color: " + textcolorAry[10] + ";font-size: 1em;}");
        htmlStr.push(".zjzjxx_p3 li{display:-webkit-box;-webkit-box-pack: justify;-webkit-box-align:center;width: 45%;height: 1.4em;line-height: 1.4em;}");
        htmlStr.push(".zjzjxx_p3 li p{width: 30%;background: " + bgcolorAry[5] + ";height: 0.8em;line-height: 0.8em;}");
        htmlStr.push(".zxjm{display: block; width: 75%;overflow: hidden; border: 1px solid #d7eef7;background: " + bgcolorAry[6] + ";color: " + '#333' + ";text-align: center;height: 2em;line-height: 2em;border-radius: 0.3em;margin: 1em auto;font-size: 1.17em;}");
        htmlStr.push(".xiangxijs{border: 1px solid #f2f2f2;width: 90%;margin: 1em auto;}");
        htmlStr.push(".zxzx {width: 90%;height: 7em;margin: 1em auto;}");
        htmlStr.push(".swt_box {width: 100%;height: auto;padding-bottom: 1.25em;}");
        htmlStr.push(".box-t {font-size: 0.92em;line-height: 150%;color:" + '#333' + ";text-align: center;width: 100%;margin: 0;height: 1.41em;}");
        htmlStr.push(".box-b {width: 100%;height: auto;padding-bottom: 1.25em;}");
        htmlStr.push(".box-l {width: 11.3%;float: left;}");
        htmlStr.push(".box-r {  position:relative; width: 77%;height: auto;display: block;color: " + textcolorAry[13] + ";border: 1px solid #6fb44d;padding:0.92em 2% 0.92em 3%;float: right;line-height: 180%;font-size: 1em;background: none repeat scroll 0% 0% #a0e75a;border-radius: 0.3em;}");
        htmlStr.push(".box-r span{display:block;width:0;height:0;border-width:10px 10px 10px 0;border-style:solid;border-color:transparent #a0e75a transparent transparent;position:absolute;top:20%;left:-8px;}");
        htmlStr.push("#dh11, #dh22{display: none;}");
        htmlStr.push(".footwb{position: fixed;z-index: 9999;bottom: 0; border-top:1px solid #dedee0; width:100%;max-width: 640px;}");
        htmlStr.push(".swt1_foot {width:100%;background:" + bgcolorAry[7] + "; padding: 0.83em 0% 0.7em;}");
        htmlStr.push(".foot_img{ float:left; width:7.8%;height: 2.3em;line-height: 2.3em; margin-left:3%;margin-right:3%;}");
        htmlStr.push(".swt1_foot .f_text {width: 62.5%; height: 2.3em;line-height: 2.3em; float: left;border-bottom: 1px solid #cfcece;display: block;font-size: 1.08em;color: " + textcolorAry[14] + ";text-indent: 0.45em;}");
        htmlStr.push(".swt1_foot a{  display:block; width:16.7%; float:right;margin-right:3%; }");
        htmlStr.push(".f_btn{display: block;background: " + bgcolorAry[8] + ";color: " + textcolorAry[15] + ";font-size: 1.08em;height: 2em;line-height: 2em;text-align: center;border-radius: 0.3em;}");
        htmlStr.push("#swt_center{display:none;background:" + bgcolorAry[9] + ";position: " + _position + "; max-width: 640px; height: 100%; left: 0; bottom: 0;right:0; z-index: 999999999;overflow: auto;margin: 0 auto;font-family:'微软雅黑';}");
        htmlStr.push("@media only screen and (min-width: 320px) and (max-width: 359px) {#swt_center {font-size: 12px !important;}}");
        htmlStr.push("@media only screen and (min-width: 360px) and (max-width: 361px) {#swt_center {font-size: 13px !important;}}");
        htmlStr.push("@media only screen and (min-width: 362px) and (max-width: 384px) {#swt_center {font-size: 14px !important;}}");
        htmlStr.push("@media only screen and (min-width: 385px) and (max-width: 480px) {#swt_center {font-size: 15px !important;}}");
        htmlStr.push("@media only screen and (min-width: 481px) and (max-width: 599px) {#swt_center {font-size: 16px !important;}}");
        htmlStr.push("@media only screen and (min-width: 600px) and (max-width: 639px) {#swt_center {font-size: 22px !important;}}");
        htmlStr.push("@media only screen and (min-width: 640px) {#swt_center {font-size: 24px !important;}}");
        htmlStr.push("</style>");

        htmlStr.push("<div id=\'swt_center\'><div class=\'center_header\' id=\'center_header\'><a class=\'headera1\'onclick=\'swt_center_n()\'><font style=\'font-family: \'宋体\';margin-right: 0.3em;\'id=\'returnback\'>&lt;</font>返回</a><div class=\'headerdivc\' onclick=\'openZoosUrl(\"\",\"&e=" + identiAry[0] + "\");\'><h1>" + textAry[0] + "</h1><p>" + textAry[1] + "</p></div><a class=\'headera2\'href=\'" + weblinkAry[0] + "\'><img src=\'" + imglinkAry[0] + "\'/></a></div><div class=\'clearb\'></div><div class=\'conten\' style=\"width:100%;\"><div class=\'yytit\'><h1>" + textAry[2] + "</h1><p class=\'\'>主管单位：<img src=\'" + imglinkAry[3] + "\'style=\'width: 2.63%;\'align=\'absmiddle\'/>" + textAry[3] + "<img src=\'" + imglinkAry[4] + "\'style=\'width: 4.91%;\'align=\'absmiddle\'/><span style='color:"+textcolorAry[4]+";'>" + textAry[4] + "</span></p></div><div class=\'xiangxijs\'><div class=\'zjzl\'onclick=\'openZoosUrl();\'><div class=\'zjzl-l\'><img src=\'" + imglinkAry[1] + "\'width=\'100%\'/></div><div class=\'zjzl-r\'><div class=\'zjzl-r_img\'><img src=\'" + imglinkAry[2] + "\'/></div><p style='color:"+textcolorAry[5]+";'>" + textAry[5] + "<span style='color:"+textcolorAry[6]+";'>" + textAry[6] + "<span></p><p style='color:"+textcolorAry[7]+";'>" + textAry[7] + "<a href=\'" + weblinkAry[1] + "\' style=\'color:"+textcolorAry[8]+";\'>" + textAry[8] + "</a></p></div><div class=\'clear\'></div></div><div class=\'zjzjxx\'><p class=\'zjzjxx_p1\' style='color:"+textcolorAry[9]+";'>" + textAry[9] + "</font></p><ul class=\'zjzjxx_p2\'><li style='color:"+textcolorAry[10]+";'>" + textAry[10] + "<font color=\'"+textcolorAry[11]+"\'>" + textAry[11] + "</font></li><li class=\'zjzjxx_p2l\'><p class=\'zjzjxx_lip\'><img src=\'http://m.hdyy.com.cn/swt/js20171106/img/ljzx.png\'align=\'absmiddle\'style=\'width: 17.19%;\'/>累计咨询：</p><font color=\'#ee7800\'>130185次</font></li></ul><ul class=\'zjzjxx_p3\'><li>咨询率：<p></p>99%</li><li>回复率：<p></p>100%</li></ul><a class=\'zxjm\'href=\'javascript:void(0);\'onclick=\'openZoosUrl(\"\",\"&e=" + identiAry[0] + "\");\'>对话已加密，请放心咨询</a></div></div><div class=\'zxzx\'style=\'height:auto;\'><div class=\'swt_box\'id=\'dh11\'><div class=\'box-t\'id=\'now1\'></div><div class=\'box-b\'><div class=\'box-l\'><img src=\'" + imglinkAry[5] + "\'width=\'100%\'/></div><a id=\"huashu1\" href=\'javascript:void(0);\'onclick=\'openZoosUrl(\"\",\"&e=" + identiAry[0] + "\");\' class=\'box-r\' style='color:"+textcolorAry[12]+";'><span></span>" + textAry[12] + "</a></div><div class=\'clear\'></div></div><div class=\'swt_box\'id=\'dh22\'><div class=\'box-b\'><div class=\'box-l\'><img src=\'" + imglinkAry[5] + "\'width=\'100%\'/></div><a href=\'javascript:void(0);\'onclick=\'openZoosUrl(\"\",\"&e=" + identiAry[0] + "\");\' class=\'box-r\'><span></span>" + textAry[13] + "</a></div><div class=\'clear\'></div></div></div><div style=\'height:55px;\'class=\'bottomdiv\' id=\'bottomdiv\'></div></div><div class=\'footwb\'><div class=\'swt1_foot\'><div class=\'foot_img\'onclick=\'openZoosUrl();\'><img src=\'http://m.hdyy.com.cn/swt/js20171106/img/foot.gif\'width=\'100%\'/></div><input type=\'text\'id=\'gmsg\'value=\'\'onfocus=\'this.value=\'\'\'onblur=\'this.value=keys\'onclick=\'openZoosUrl();\'autocomplete=\'off\' class=\'f_text\'><a class=\'f_btn\'href=\'javascript:void(0);\'onclick=\'openZoosUrl();\'>发送</a><div class=\'clear\'></div></div></div></div>");

        var o = document.createElement('div');
        o.innerHTML = htmlStr.join('');
        while (o.firstElementChild) {
            document.body.appendChild(o.firstElementChild);
        };

        swt_center_b = function () {
            swt_center.style.display = "block";
            var clearb = document.querySelector(".clearb");
            clearb.style.height = document.querySelector("#center_header").clientHeight + "px";
            setTimeout("dh11()", 1000);
        }
        setTimeout(swt_center_b, config.firsttime * 1000)
        swt_center_n = function () {
            swt_center.style.display = "none";
            document.getElementById("dh11").style.display = "none";
            document.getElementById("dh22").style.display = "none";
            setTimeout(swt_center_b, config.relapsetime * 1000)
        }
        dh11 = function () {
            document.getElementById("dh11").style.display = "block";
            setTimeout(dh22, 2000);
            swt_center.scrollTop = document.getElementById("bottomdiv").offsetTop - document.documentElement.scrollTop;
        }
        dh22 = function () {
            document.getElementById("dh22").style.display = "block";
            swt_center.scrollTop = document.getElementById("bottomdiv").offsetTop - document.documentElement.scrollTop;
        }
        var now = new Date();
        var hh = now.getHours();
        var mm = now.getMinutes();
        var ss = now.getSeconds();
        var date1 = document.getElementById("now1");
        function getDateWeek(obj) { if (obj < 10) return "0" + obj; else return obj; }
        date1.innerHTML = getDateWeek(hh) + ":" + getDateWeek(mm) + ":" + getDateWeek(ss);

        function addEvent(obj, type, fn) {
            if (obj.attachEvent) {
                obj.attachEvent('on' + type, function () {
                    fn.call(obj);
                })
            } else {
                obj.addEventListener(type, fn, false);
            }
        }
        if (_ua_text) {
            var _t = document.getElementById('swt_center').style.top;
            window.onscroll = function () {
                document.getElementById('swt_center').style.top = parseInt(_t) + (getScrollTop() / getClientHeight()) * 100 + '%';
            }
        }

    };
    lib.load(loadFunc);
})('{{lib}}', '{{config}}');